{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "50274744",
   "metadata": {},
   "source": [
    "_______\n",
    "* 2022/9/5/week03\n",
    "* 课程：Python\n",
    "* 记录人：成志鹏"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "54b79716",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "D:\\2022-2023-01\\python\\week 03\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "print(os.path.abspath(' . '))"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2907e5b9",
   "metadata": {},
   "source": [
    "# 本周学习目标\n",
    "\n",
    ">1. 模块\n",
    "\n",
    ">2. 变量\n",
    "\n",
    ">3. 循环遍历\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b71e8b5e",
   "metadata": {},
   "source": [
    "## 1.模块（标准库）\n",
    "\n",
    "> python创始人团队为后面使用这门编程语言的人提供的解决日常生活可能使用到的功能，而制作的可以方便使用的模块"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "c3c92325",
   "metadata": {},
   "outputs": [],
   "source": [
    "import time"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d98750f2",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1662345933.4909105"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# 纪元(1970.1.1)\n",
    "# 时间戳\n",
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "75757e7e",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1662346026.8745508"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.time()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "12512d21",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=5, tm_hour=10, tm_min=47, tm_sec=26, tm_wday=0, tm_yday=248, tm_isdst=0)"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.localtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "90a01304",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "time.struct_time(tm_year=2022, tm_mon=9, tm_mday=5, tm_hour=2, tm_min=47, tm_sec=55, tm_wday=0, tm_yday=248, tm_isdst=0)"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.gmtime()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "bfc3fc98",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Mon Sep  5 10:53:42 2022'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "time.asctime(time.localtime())"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ace54e3e",
   "metadata": {},
   "source": [
    "## 1.2 模块（开源模块）\n",
    "> 1. 因为代码开源\n",
    "> 2. 集合全领域（全人类）的需求\n",
    "> 3. 按照国际标准开放的模块库"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5ab3f7c0",
   "metadata": {},
   "source": [
    "### 1.3 模块（自定义模块）\n",
    ">1. 不愿意开源的有一定知识产权的（开放API租用形式开放）\n",
    ">2. 自己用的，写的也不怎么好，开源出去丢人的。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4341b3a2",
   "metadata": {},
   "source": [
    "## 2.变量\n",
    "> 1. 声明变量(命名）规则\n",
    ">> 1. 变量名只能是字母、数字或下划线的任意组合"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "6e6eaef3",
   "metadata": {},
   "outputs": [],
   "source": [
    "网三_01 =\"Xiao Hong\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "389be9ae",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'Xiao Hong'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网三_01"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "3a91fa11",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "2731869958640"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "id(网三_01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "2ba1fbcf",
   "metadata": {},
   "outputs": [],
   "source": [
    "网三_01_age = 19"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "e0d08b4d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "19"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "网三_01_age"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "76745fb7",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "180000001 180000001\n"
     ]
    }
   ],
   "source": [
    "# 案例（关于变量）\n",
    "\n",
    "网三_01_ID = \"180000001\"\n",
    "\n",
    "网三_02_ID = 网三_01_ID\n",
    "\n",
    "print(网三_02_ID,网三_01_ID)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "59fd1de5",
   "metadata": {},
   "outputs": [],
   "source": [
    "网三_01_ID = \"180000006\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "id": "52958b13",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "180000006 180000001\n"
     ]
    }
   ],
   "source": [
    "print(网三_01_ID,网三_02_ID)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cb4d19d8",
   "metadata": {},
   "source": [
    "# 课后作业\n",
    "\n",
    "* 1. 课本p4项目练习"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
